package earogya.pharmacy.pharmacy.messages;

import java.io.IOException;
import ca.uhn.hl7v2.HL7Exception;
import ca.uhn.hl7v2.model.DataTypeException;
import ca.uhn.hl7v2.model.v251.message.RGV_O15;
import earogya.pharmacy.pharmacy.OrderDrugs;
import earogya.pharmacy.pharmacy.PharmacyHibernateManager;

public class RGV_O15_Order {

	private RGV_O15 adrMsg;
	private PharmacyHibernateManager hibernate_manager = new PharmacyHibernateManager();
	private OrderDrugs order = new OrderDrugs();

	public RGV_O15_Order(RGV_O15 adrMsg) {
		this.adrMsg = adrMsg;
	}

	public String manageMessage() throws HL7Exception, IOException {
		String ack = null;
		try {
			ack = adrMsg.generateACK().encode();
			this.updateOrderDetails();
		} catch (HL7Exception e) {
			ack = adrMsg.generateACK("OE", e).encode();
		}
		return ack;
	}

	public void updateOrderDetails() throws DataTypeException {		
	}
	}
